//
//  PKTweetViewController.swift
//  Panku
//
//  Created by mac on 2017/4/29.
//  Copyright © 2017年 Monster. All rights reserved.
//

import UIKit

class PKTweetViewController: PKBaseViewController {
    
    //properties
    //UI
    lazy var webView = PKBaseWebView()
    var commentBar = PKCommentBar(thumbUpCallback: { 
        //点击赞
    }, commentCallback: { 
        //点击评论
    }) { 
        //点击分享
    }

    //viewModel
    var viewModel:PKTweetViewModel?
    
    //MARK: - init
    init(viewModel:PKTweetViewModel){
        super.init(nibName: nil, bundle: nil)
        self.viewModel = viewModel
    }
    
    public func loadURL(urlString:String){
        let url = URL(string: urlString)
        let request = URLRequest(url: url!)
        webView.loadRequest(request)
    }
    
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func setupRootView() {
        
    }
    
    override func setupSubViews() {
        view.addSubview(webView)
        view.addSubview(commentBar)
        
//        webView.loadURL(urlString: <#String#>)
    }
    
    override func setupSubViewsConstraints() {
        webView.snp.makeConstraints { (make) in
            make.top.equalTo(view.snp.top)
            make.left.equalTo(view.snp.left)
            make.right.equalTo(view.snp.right)
            make.bottom.equalTo(commentBar.snp.top)
        }
        
        commentBar.snp.makeConstraints { (make) in
            make.left.equalTo(view.snp.left)
            make.right.equalTo(view.snp.right)
            make.bottom.equalTo(view.snp.bottom)
            make.height.equalTo(44)
        }
    }
    
    override func setupNavigationBar() {
        
    }
    
    override func bindViewModel() {
        
    }


}
